

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>纠删码 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="纠删码配置" href="../erasure-code-profile/" />
    <link rel="prev" title="存储池" href="../pools/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../">集群运维</a></li>
      <li class="breadcrumb-item active">纠删码</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/rados/operations/erasure-code.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">运维</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../operating/">操纵集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../health-checks/">健康检查</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring/">监控集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring-osd-pg/">监控 OSD 和归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../user-management/">用户管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pgcalc/">PG Calc</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-placement/">数据归置概览</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pools/">存储池</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">纠删码</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">创建纠删码存储池样板</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">纠删码配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">在纠删码存储池上启用重写功能</a></li>
<li class="toctree-l4"><a class="reference internal" href="#erasure-coded-pool-overhead">Erasure-coded pool overhead</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">纠删码存储池与缓存分级</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id9">纠删码存储池的恢复</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id10">术语</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id11">内容列表</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../cache-tiering/">分级缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="../placement-groups/">归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upmap/">使用 pg-upmap</a></li>
<li class="toctree-l3"><a class="reference internal" href="../read-balancer/">Operating the Read (Primary) Balancer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../balancer/">均衡器模块</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map/">CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map-edits/">手动编辑一个 CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../stretch-mode/">Stretch Clusters</a></li>
<li class="toctree-l3"><a class="reference internal" href="../change-mon-elections/">Configuring Monitor Election Strategies</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-osds/">增加/删除 OSD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-mons/">增加/删除监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../devices/">设备管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-migration/">迁移到 BlueStore</a></li>
<li class="toctree-l3"><a class="reference internal" href="../control/">命令参考</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/community/">Ceph 社区</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-mon/">监视器故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-osd/">OSD 故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-pg/">归置组排障</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/log-and-debug/">日志记录和调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/cpu-profiling/">CPU 剖析</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/memory-profiling/">内存剖析</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="ecpool">
<span id="id1"></span><h1>纠删码<a class="headerlink" href="#ecpool" title="Permalink to this heading"></a></h1>
<p>By default, Ceph <a class="reference external" href="../pools">pools</a> are created with the type “replicated”. In
replicated-type pools, every object is copied to multiple disks. This
multiple copying is the method of data protection known as “replication”.</p>
<p>By contrast, <a class="reference external" href="https://en.wikipedia.org/wiki/Erasure_code">erasure-coded</a>
pools use a method of data protection that is different from replication. In
erasure coding, data is broken into fragments of two kinds: data blocks and
parity blocks. If a drive fails or becomes corrupted, the parity blocks are
used to rebuild the data. At scale, erasure coding saves space relative to
replication.</p>
<p>In this documentation, data blocks are referred to as “data chunks”
and parity blocks are referred to as “coding chunks”.</p>
<p>Erasure codes are also called “forward error correction codes”. The
first forward error correction code was developed in 1950 by Richard
Hamming at Bell Laboratories.</p>
<section id="id2">
<h2>创建纠删码存储池样板<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>The simplest erasure coded pool is equivalent to <a class="reference external" href="https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5">RAID5</a> and
requires at least three hosts:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "$ ";
}
</style><span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>pool<span class="w"> </span>create<span class="w"> </span>ecpool<span class="w"> </span>erasure</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pool</span> <span class="s1">&#39;ecpool&#39;</span> <span class="n">created</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1"><span class="nb">echo</span><span class="w"> </span>ABCDEFGHI<span class="w"> </span><span class="p">|</span><span class="w"> </span>rados<span class="w"> </span>--pool<span class="w"> </span>ecpool<span class="w"> </span>put<span class="w"> </span>NYAN<span class="w"> </span>-</span>
<span class="prompt1">rados<span class="w"> </span>--pool<span class="w"> </span>ecpool<span class="w"> </span>get<span class="w"> </span>NYAN<span class="w"> </span>-</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ABCDEFGHI</span>
</pre></div>
</div>
</section>
<section id="id3">
<h2>纠删码配置<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<p>默认的纠删码配置可容忍连续两个 OSD 的损失，而不丢失数据。
这个纠删码配置相当于副本数为三的多副本存储池，但存储需求却不同：
它只需 2TB 的空间即可存储 1TB 数据，而不是 3TB 空间存储 1TB 数据。默认配置可这样查看：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>erasure-code-profile<span class="w"> </span>get<span class="w"> </span>default</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">k</span><span class="o">=</span><span class="mi">2</span>
<span class="n">m</span><span class="o">=</span><span class="mi">2</span>
<span class="n">plugin</span><span class="o">=</span><span class="n">jerasure</span>
<span class="n">crush</span><span class="o">-</span><span class="n">failure</span><span class="o">-</span><span class="n">domain</span><span class="o">=</span><span class="n">host</span>
<span class="n">technique</span><span class="o">=</span><span class="n">reed_sol_van</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The profile just displayed is for the <em>default</em> erasure-coded pool, not the
<em>simplest</em> erasure-coded pool. These two pools are not the same:</p>
<blockquote>
<div><p>The default erasure-coded pool has two data chunks (K) and two coding chunks
(M). The profile of the default erasure-coded pool is “k=2 m=2”.</p>
<p>The simplest erasure-coded pool has two data chunks (K) and one coding chunk
(M). The profile of the simplest erasure-coded pool is “k=2 m=1”.</p>
</div></blockquote>
</div>
<p>确定合理的配置很重要，因为存储池创建后就不能再修改了。
If you find that you need an erasure-coded pool with
a profile different than the one you have created, you must create a new pool
with a different (and presumably more carefully considered) profile. When the
new pool is created, all objects from the wrongly configured pool must be moved
to the newly created pool. There is no way to alter the profile of a pool after
the pool has been created.</p>
<p>配置文件里最重要的参数是 <em>K</em> 、 <em>M</em> 和
<em>crush-failure-domain</em> ，因为它们决定了存储的开销和数据的持久性。
例如，假设期望的系统架构必须能承受两个故障机架和 67% 的开销，
可以用下列配置文件：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>erasure-code-profile<span class="w"> </span><span class="nb">set</span><span class="w"> </span>myprofile<span class="w"> </span><span class="se">\</span>
<span class="w">    </span><span class="nv">k</span><span class="o">=</span><span class="m">3</span><span class="w"> </span><span class="se">\</span>
<span class="w">    </span><span class="nv">m</span><span class="o">=</span><span class="m">2</span><span class="w"> </span><span class="se">\</span>
<span class="w">    </span>crush-failure-domain<span class="o">=</span>rack</span>
<span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>pool<span class="w"> </span>create<span class="w"> </span>ecpool<span class="w"> </span>erasure<span class="w"> </span>myprofile</span>
<span class="prompt1"><span class="nb">echo</span><span class="w"> </span>ABCDEFGHI<span class="w"> </span><span class="p">|</span><span class="w"> </span>rados<span class="w"> </span>--pool<span class="w"> </span>ecpool<span class="w"> </span>put<span class="w"> </span>NYAN<span class="w"> </span>-</span>
<span class="prompt1">rados<span class="w"> </span>--pool<span class="w"> </span>ecpool<span class="w"> </span>get<span class="w"> </span>NYAN<span class="w"> </span>-</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ABCDEFGHI</span>
</pre></div>
</div>
<p>对象 <em>NYAN</em> 将被分割成三块（ <em>K=3</em> ）、
并额外创建两个 <em>校验块</em>（ <em>M=2</em> ）。
<em>M</em> 值决定了在不丢数据的前提下可以同时失去多少 OSD 。
<em>crush-failure-domain=rack</em> 能使创建的 CRUSH 规则可确保两个<em>校验块</em>不会存储在同一机架上。</p>
<p class="ditaa">
<img src="../../../_images/ditaa-4f48e65a64e478df79cdb8126c3c7639b86c550c.png"/>
</p>
<p>More information can be found in the <a class="reference external" href="../erasure-code-profile">erasure code profiles</a> documentation.</p>
</section>
<section id="id4">
<h2>在纠删码存储池上启用重写功能<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h2>
<p>默认情况下，纠删码存储池只适用于像 RGW 这样进行完整对象写入和追加的场景。</p>
<p>从 Luminous 起，在纠删码存储池里进行部分写入的功能可以在存储池配置里启用，这样 RBD 和 CephFS 就可以使用纠删码存储池存储数据了：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>pool<span class="w"> </span><span class="nb">set</span><span class="w"> </span>ec_pool<span class="w"> </span>allow_ec_overwrites<span class="w"> </span><span class="nb">true</span></span>
</pre></div></div><p>只有当存储池座落于 bluestore 格式的 OSD 上时才能启用此功能，因为 bluestore 的校验和功能在深度洗刷时能探测到位翻转或者其它的损坏。除了不安全外，在 filestore 上使用 EC 重写的性能也比
bluestore 上差得多。</p>
<p>纠删码存储池不支持 omap ，所以用于 RBD 和 CephFS 时你必须让它们把数据存到 EC 存储池里、而元数据存到副本存储池里。对 RBD 而言，这意味着在创建映像时要用纠删码存储池作 <code class="docutils literal notranslate"><span class="pre">--data-pool</span></code> （数据存储池）的参数：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">rbd<span class="w"> </span>create<span class="w"> </span>--size<span class="w"> </span>1G<span class="w"> </span>--data-pool<span class="w"> </span>ec_pool<span class="w"> </span>replicated_pool/image_name</span>
</pre></div></div><p>对 CephFS 而言，可在文件系统创建期间、或通过<a class="reference external" href="../../../cephfs/file-layouts">文件布局</a>把一个纠删码存储池设置为默认的数据存储池。</p>
</section>
<section id="erasure-coded-pool-overhead">
<h2>Erasure-coded pool overhead<a class="headerlink" href="#erasure-coded-pool-overhead" title="Permalink to this heading"></a></h2>
<p>The overhead factor (space amplification) of an erasure-coded pool
is <cite>(k+m) / k</cite>.  For a 4,2 profile, the overhead is
thus 1.5, which means that 1.5 GiB of underlying storage are used to store
1 GiB of user data.  Contrast with default three-way replication, with
which the overhead factor is 3.0.  Do not mistake erasure coding for a free
lunch: there is a significant performance tradeoff, especially when using HDDs
and when performing cluster recovery or backfill.</p>
<p>Below is a table showing the overhead factors for various values of <cite>k</cite> and <cite>m</cite>.
As <cite>m</cite> increases above 2, the incremental capacity overhead gain quickly
experiences diminishing returns but the performance impact grows proportionally.
We recommend that you do not choose a profile with <cite>k</cite> &gt; 4 or <cite>m</cite> &gt; 2 until
and unless you fully understand the ramifications, including the number of
failure domains your cluster topology must contain.  If  you choose <cite>m=1</cite>,
expect data unavailability during maintenance and data loss if component
failures overlap.</p>
<table class="docutils align-default" id="id12">
<caption><span class="caption-text">Erasure coding overhead</span><a class="headerlink" href="#id12" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
<col style="width: 8.3%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head stub"></th>
<th class="head"><p>m=1</p></th>
<th class="head"><p>m=2</p></th>
<th class="head"><p>m=3</p></th>
<th class="head"><p>m=4</p></th>
<th class="head"><p>m=5</p></th>
<th class="head"><p>m=6</p></th>
<th class="head"><p>m=7</p></th>
<th class="head"><p>m=8</p></th>
<th class="head"><p>m=9</p></th>
<th class="head"><p>m=10</p></th>
<th class="head"><p>m=11</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><th class="stub"><p>k=1</p></th>
<td><p>2.00</p></td>
<td><p>3.00</p></td>
<td><p>4.00</p></td>
<td><p>5.00</p></td>
<td><p>6.00</p></td>
<td><p>7.00</p></td>
<td><p>8.00</p></td>
<td><p>9.00</p></td>
<td><p>10.00</p></td>
<td><p>11.00</p></td>
<td><p>12.00</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>k=2</p></th>
<td><p>1.50</p></td>
<td><p>2.00</p></td>
<td><p>2.50</p></td>
<td><p>3.00</p></td>
<td><p>3.50</p></td>
<td><p>4.00</p></td>
<td><p>4.50</p></td>
<td><p>5.00</p></td>
<td><p>5.50</p></td>
<td><p>6.00</p></td>
<td><p>6.50</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>k=3</p></th>
<td><p>1.33</p></td>
<td><p>1.67</p></td>
<td><p>2.00</p></td>
<td><p>2.33</p></td>
<td><p>2.67</p></td>
<td><p>3.00</p></td>
<td><p>3.33</p></td>
<td><p>3.67</p></td>
<td><p>4.00</p></td>
<td><p>4.33</p></td>
<td><p>4.67</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>k=4</p></th>
<td><p>1.25</p></td>
<td><p>1.50</p></td>
<td><p>1.75</p></td>
<td><p>2.00</p></td>
<td><p>2.25</p></td>
<td><p>2.50</p></td>
<td><p>2.75</p></td>
<td><p>3.00</p></td>
<td><p>3.25</p></td>
<td><p>3.50</p></td>
<td><p>3.75</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>k=5</p></th>
<td><p>1.20</p></td>
<td><p>1.40</p></td>
<td><p>1.60</p></td>
<td><p>1.80</p></td>
<td><p>2.00</p></td>
<td><p>2.20</p></td>
<td><p>2.40</p></td>
<td><p>2.60</p></td>
<td><p>2.80</p></td>
<td><p>3.00</p></td>
<td><p>3.20</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>k=6</p></th>
<td><p>1.16</p></td>
<td><p>1.33</p></td>
<td><p>1.50</p></td>
<td><p>1.66</p></td>
<td><p>1.83</p></td>
<td><p>2.00</p></td>
<td><p>2.17</p></td>
<td><p>2.33</p></td>
<td><p>2.50</p></td>
<td><p>2.66</p></td>
<td><p>2.83</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>k=7</p></th>
<td><p>1.14</p></td>
<td><p>1.29</p></td>
<td><p>1.43</p></td>
<td><p>1.58</p></td>
<td><p>1.71</p></td>
<td><p>1.86</p></td>
<td><p>2.00</p></td>
<td><p>2.14</p></td>
<td><p>2.29</p></td>
<td><p>2.43</p></td>
<td><p>2.58</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>k=8</p></th>
<td><p>1.13</p></td>
<td><p>1.25</p></td>
<td><p>1.38</p></td>
<td><p>1.50</p></td>
<td><p>1.63</p></td>
<td><p>1.75</p></td>
<td><p>1.88</p></td>
<td><p>2.00</p></td>
<td><p>2.13</p></td>
<td><p>2.25</p></td>
<td><p>2.38</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>k=9</p></th>
<td><p>1.11</p></td>
<td><p>1.22</p></td>
<td><p>1.33</p></td>
<td><p>1.44</p></td>
<td><p>1.56</p></td>
<td><p>1.67</p></td>
<td><p>1.78</p></td>
<td><p>1.88</p></td>
<td><p>2.00</p></td>
<td><p>2.11</p></td>
<td><p>2.22</p></td>
</tr>
<tr class="row-odd"><th class="stub"><p>k=10</p></th>
<td><p>1.10</p></td>
<td><p>1.20</p></td>
<td><p>1.30</p></td>
<td><p>1.40</p></td>
<td><p>1.50</p></td>
<td><p>1.60</p></td>
<td><p>1.70</p></td>
<td><p>1.80</p></td>
<td><p>1.90</p></td>
<td><p>2.00</p></td>
<td><p>2.10</p></td>
</tr>
<tr class="row-even"><th class="stub"><p>k=11</p></th>
<td><p>1.09</p></td>
<td><p>1.18</p></td>
<td><p>1.27</p></td>
<td><p>1.36</p></td>
<td><p>1.45</p></td>
<td><p>1.54</p></td>
<td><p>1.63</p></td>
<td><p>1.72</p></td>
<td><p>1.82</p></td>
<td><p>1.91</p></td>
<td><p>2.00</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id6">
<h2>纠删码存储池与缓存分级<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Cache tiering is deprecated in Reef.</p>
</div>
<p>纠删码存储池与副本存储池相比需要的计算资源更多，而且还缺少一些功能，像 omap 。要消除这些局限性，可以在纠删码存储池前加一个<a class="reference external" href="../cache-tiering">缓存层</a>。</p>
<p>For example, if the pool <em>hot-storage</em> is made of fast storage, the following commands
will place the <em>hot-storage</em> pool as a tier of <em>ecpool</em> in <em>writeback</em>
mode:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>tier<span class="w"> </span>add<span class="w"> </span>ecpool<span class="w"> </span>hot-storage</span>
<span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>tier<span class="w"> </span>cache-mode<span class="w"> </span>hot-storage<span class="w"> </span>writeback</span>
<span class="prompt1">ceph<span class="w"> </span>osd<span class="w"> </span>tier<span class="w"> </span>set-overlay<span class="w"> </span>ecpool<span class="w"> </span>hot-storage</span>
</pre></div></div><p>如此一来，到 <em>ecpool</em> 的每个写和读实际上用的是
<em>hot-storage</em> ，而且还受益于其灵活性和速度。</p>
<p>更详细的文档请参阅<a class="reference external" href="../cache-tiering">分级缓存</a>。
注意：缓存分级功能已经废弃，以后的版本会完全删除。</p>
</section>
<section id="id9">
<h2>纠删码存储池的恢复<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h2>
<p>If an erasure-coded pool loses any data shards, it must recover them from others.
This recovery involves reading from the remaining shards, reconstructing the data, and
writing new shards.</p>
<p>In Octopus and later releases, erasure-coded pools can recover as long as there are at least <em>K</em> shards
available. (With fewer than <em>K</em> shards, you have actually lost data!)</p>
<p>Prior to Octopus, erasure-coded pools required that at least <code class="docutils literal notranslate"><span class="pre">min_size</span></code> shards be
available, even if <code class="docutils literal notranslate"><span class="pre">min_size</span></code> was greater than <code class="docutils literal notranslate"><span class="pre">K</span></code>. This was a conservative
decision made out of an abundance of caution when designing the new pool
mode. As a result, however, pools with lost OSDs but without complete data loss were
unable to recover and go active without manual intervention to temporarily change
the <code class="docutils literal notranslate"><span class="pre">min_size</span></code> setting.</p>
<p>We recommend that <code class="docutils literal notranslate"><span class="pre">min_size</span></code> be <code class="docutils literal notranslate"><span class="pre">K+1</span></code> or greater to prevent loss of writes and
loss of data.</p>
</section>
<section id="id10">
<h2>术语<a class="headerlink" href="#id10" title="Permalink to this heading"></a></h2>
<dl class="simple">
<dt><em>chunk</em></dt><dd><p>When the encoding function is called, it returns chunks of the same size as each other. There are two
kinds of chunks: (1) <em>data chunks</em>, which can be concatenated to reconstruct the original object, and
(2) <em>coding chunks</em>, which can be used to rebuild a lost chunk.</p>
</dd>
<dt><em>K</em></dt><dd><p>The number of data chunks into which an object is divided. For example, if <em>K</em> = 2, then a 10KB object
is divided into two objects of 5KB each.</p>
</dd>
<dt><em>M</em></dt><dd><p>The number of coding chunks computed by the encoding function. <em>M</em> is equal to the number of OSDs that can
be missing from the cluster without the cluster suffering data loss. For example, if there are two coding
chunks, then two OSDs can be missing without data loss.</p>
</dd>
</dl>
</section>
<section id="id11">
<h2>内容列表<a class="headerlink" href="#id11" title="Permalink to this heading"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-profile/">纠删码配置</a></li>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-jerasure/">Jerasure 纠删码插件</a></li>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-isa/">ISA 纠删码插件</a></li>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-lrc/">局部自修复纠删码插件</a></li>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-shec/">SHEC 纠删码插件</a></li>
<li class="toctree-l1"><a class="reference internal" href="../erasure-code-clay/">CLAY 码插件</a></li>
</ul>
</div>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../pools/" class="btn btn-neutral float-left" title="存储池" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../erasure-code-profile/" class="btn btn-neutral float-right" title="纠删码配置" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>